﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

namespace Analysis.Controls
{
    public partial class ExcelImportColumnErrorList : System.Web.UI.UserControl
    {
        public string JsCodeToRunOnReady { get; set; }

        protected void Page_Load(object sender, EventArgs e)
        {

        }

        public void LoadData(DataTable dataSource)
        {
            gridExcelImportColumnError.DataSource = dataSource;
            gridExcelImportColumnError.DataBind();
            upExcelImportColumnError.Update();
        }

        public void ShowDialog()
        {
            JsCodeToRunOnReady = "showExcelImportColumnErrorList();";
        }

        protected void upExcelImportColumnError_Load(object sender, EventArgs e)
        {
        }

        protected void gridExcelImportColumnError_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                DataRowView item = (DataRowView)e.Row.DataItem;

                if (item["ColumnName"].ToString().ToLower() != item["FileColumnName"].ToString().ToLower())
                {
                    e.Row.Style.Add("color", "red");
                }
            }
        }
    }
}